package cn.itsource.pethome.org.controller;

import cn.itsource.pethome.basic.util.Result;
import cn.itsource.pethome.org.domain.Shop;
import cn.itsource.pethome.org.service.IShopService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/shop")
public class ShopController {
    @Autowired
    IShopService shopService;


    @PostMapping("/settlement")
    public Result settlement(@RequestBody Shop shop){
        try {
            shopService.save(shop);
            return new Result();
        } catch (Exception e) {
            e.printStackTrace();
            return new Result(false,e.getMessage());
        }
    }

}
